﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SpreadsheetGear;
using WorkbookDesigner.Main;
using SGForm = SpreadsheetGear.Windows.Forms;
using DesignerHelper.Help;

namespace WorkbookDesigner.Addons
{
    internal static class Basic
    {
        public static void ShowWorkbookExplorer(SGForm.WorkbookView workbookView)
        {
            workbookView.GetLock();
            try
            {
                SGForm.WorkbookExplorer explorer =
                    new SGForm.WorkbookExplorer(workbookView.ActiveWorkbookSet);
                
                explorer.Show(workbookView);
            }
            finally
            {
                workbookView.ReleaseLock();
            }
        }
        public static void ShowRangeExplorer(SGForm.WorkbookView workbookView)
        {
            workbookView.GetLock();
            try
            {
                SGForm.RangeExplorer explorer =
                    new SGForm.RangeExplorer(workbookView.ActiveWorkbookSet, SGForm.RangeExplorerCategoryFlags.All);
                explorer.Show(workbookView);
            }
            finally
            {
                workbookView.ReleaseLock();
            }
        }
        public static void ShowShapeExplorer(SGForm.WorkbookView workbookView)
        {
            workbookView.GetLock();
            try
            {
                SGForm.ShapeExplorerCategoryFlags
                    categoryFlags = SGForm.ShapeExplorerCategoryFlags.All;
                SGForm.ShapeExplorer explorer =
                    new SGForm.ShapeExplorer(workbookView.ActiveWorkbookSet, categoryFlags);
                explorer.Show(workbookView);
            }
            finally
            {
                workbookView.ReleaseLock();
            }
        }


    }

}
